<?php
/*
*	created by cbq in 2017.02.08
*	站点相关模型
*/
defined('BASEPATH') OR exit('No direct script access allowed');
class AdminuserRecord_m extends MY_Model {
    public function __construct()
    {
        parent::__construct();
        $this->table='adminuser_record';
    }
    //写入操作日志
	public function add($type,$resultflag,$des){
		$eduadmininfo=$_SESSION['eduadmininfo'];
		$eduadmininfo=unserialize($eduadmininfo);
		//1=>'新建',2=>'修改',3=>'删除',4=>'打开',5=>'发布',6=>'审核',
		$data['type']=$type;
		$data['resultflag']=$resultflag;//1成功2失败
		$data['userid']=$eduadmininfo['id'];
		$data['addtime']=time();
		$data['userip']=get_client_ip();
		$data['description']=$des;
		$this->db->insert('adminuser_record',$data);
		$addid=$this->db->insert_id();
		if($addid){return $addid;}
		$result=$this->db->affected_rows();
		if(!$result){
			return false;
		}
		return true;
	}
}
?>